package io.bdmc.modules.bss.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author huang lu
 * @since 2019-01-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SmkAlarm extends Model<SmkAlarm> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "alarm_id", type = IdType.AUTO)
    private Long alarmId;

    /**
     * 设备id
     */
    private Long devId;

    /**
     * 报警详情
     */
    private String alarmDetail;

    /**
     * 报警状态1=未确认，2=已确认
     */
    private Integer alarmStat;

    /**
     * 报警原因  （1-9）明火走火，漏电，自燃，人为纵火，易燃易爆物品燃爆，用电负荷超载，雷击，生活用火不慎，生产作业不慎
     */
    private Integer alarmReason;

    /**
     * 报警时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime alarmTime;

    /**
     * { key: 1, value: "离线" },
        { key: 2, value: "火警" },
        { key: 3, value: "传感器故障" },
        { key: 4, value: "拆除报警" },
        { key: 5, value: "低压报警" }
        { key: 6, value: "火警解除" }
     */
    private Integer alarmType;

    /**
     * 消息类型，三江回传
     */
    private String rawData;

    /**
     * 消息ID（消息时间毫秒数）
     */
    private String oid;

    /**
     * 1电话确认，2视频确认，3app图片确认，4自动确认，5其他方式
     */
    private Integer dealMethod;

    /**
     * 处理结果
     */
    private String dealResult;

    /**
     * 1真实火警，2误报，3故障，4测试
     */
    private Integer dealType;

    
    /**
     * 处理人
     */
    private String dealBy;

       /**
     * 处理时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime dealTime;

    private String joinBy;

    private LocalDateTime joinDate;

    @TableField(exist=false)
    private String imei;

    @TableField(exist=false)
    private String iccid;

    @TableField(exist=false)
    private String devName;

    @TableField(exist=false)
    private String devModel;

    @TableField(exist=false)
    private String shopName;

    @TableField(exist=false)
    private String depName;

    @TableField(exist=false)
    private String installAddr;

    @TableField(exist=false)
    private String shopAddr;
    
    @TableField(exist=false)
    private String managerName;

    @TableField(exist=false)
    private String managerMobile;
    
    @Override
    protected Serializable pkVal() {
        return this.alarmId;
    }

    @Override
    public String toString() {
        return "SmkAlarm{" +
        "alarmId=" + alarmId +
        ", devId=" + devId +
        ", alarmDetail=" + alarmDetail +
        ", alarmStat=" + alarmStat +
        ", alarmTime=" + alarmTime +
        ", alarmType=" + alarmType +
        ", rawData=" + rawData +
        ", oid=" + oid +
        ", dealMethod=" + dealMethod +
        ", dealResult=" + dealResult +
        ", dealType=" + dealType +
        ", joinBy=" + joinBy +
        ", joinDate=" + joinDate +
        "}";
    }
}
